Dynomotion

Group: DynoMotion Message: 12267 From: collimero Date: 9/17/2015
Subject: Kflop Dest command returns high values

Hi All,

I'm new to using the KFlop controller. Currently, I'm making a program in VB (Visual studio 2013) to control an advanced 3D printer using KFlop configured as pulse / direction output. 


I've got everything up and running and it's working pretty well, even with all 8 axes. It seems to be sending out all the right pulses. However, I've got this problem that during movement, the KFlop controller returns position values that are 1E+10 or 1E+11 too high when I request the position using the "Dest<n>"-command. The Pos<n>-command does not seem to work, it always returns 0.


If I just use the standard move<n>= command, I see that after the movement is finished, the size of the number returns to the normal value. However, if I use the jog<n>= command, the value returned by the Dest<n>-command remains a factor 1000000000 too high after the jog value has returned to 0.


When I open the KMotion-app at the same time with my app, I see that the Axis screen of the KMotion app shows the right values, So, for example: my app shows: -5697756279069,00 whereas KMotion shows -569.78. 


At first I thought I made some programming error, however, the VB example named Dynomotion VB.net on the Dynomotion website has exactly the same problem. If you compile it and use the jog, it will show a very high value for the position, whereas the KMotion-app will at the same time display a value ten billion times lower. I tried Visual studio 2008, but the same problem here. Also it is not a question of the right use of the formatNumber command.


Anyone have an idea how to solve this issue? It seems to be an error in the supplied dlls.

Best regards, Jeroen 

 

Group: DynoMotion Message: 12278 From: Tom Kerekes Date: 9/18/2015
Subject: Re: Kflop Dest command returns high values
Hi Jeroen,

That seems to be caused by your Windows' Region and Language settings using a "," instead of a "." for the decimal place character.  KFLOP doesn't have language settings and will always accept/return values using "." to represent the decimal point.

You are correct the Dynomotion VB.Net example has the same problem if the Window's Region is changed. If the application uses the programming run time libraries to convert numbers it will assume the format of your Region.

To force the Runtime libraries to use US English format in the Dynomotion VB.Net example you can add the line shown below in Bold.  If you require your Screen format to be still in your Region's format you will need to come up with a more specific solution.


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
        System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
    End Sub
HTH
Regards
TK



Group: DynoMotion Message: 12281 From: collimero Date: 9/20/2015
Subject: Re: Kflop Dest command returns high values
Thanks Tom, that really clears things up for me. I guess, since the communication works with passing around strings, there is not really an easy solution to cater for different regional settings. I will try this suggestion, I'm pretty sure it will work.
Best regards, 
Jeroen